package com.example.wineknower.fragment;


import android.content.Intent;
import android.net.http.SslError;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.SslErrorHandler;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import androidx.fragment.app.Fragment;

import com.example.wineknower.R;

public class ZhiDaoDetailsFragment extends Fragment  {

    private String Url;

    public ZhiDaoDetailsFragment(String url) {
        this.Url = url;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.zhidaodetails_activity, container, false);

//        Intent i= getActivity().getIntent();
//        String url = i.getStringExtra("url");
        WebView webView = view.findViewById(R.id.zhidao_webview);
        System.out.println("url = " + Url);
//        webView.loadUrl(Url);
//        webView.setWebViewClient(new WebViewClient(){
//            @Override
//            public boolean shouldOverrideUrlLoading(WebView view, String url) {
//                view.loadUrl(url);
//                return true;
//            }
//            @Override
//            public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
//                handler.proceed(); //信任所有证书
//            }
//        });

        return view;
    }




}
